package com.fh.test.spring.xmlconfig.soundsystem;

import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * 使用junit5进行单元测试
 */
//@RunWith(SpringJUnit5ClassRunner.class)
@ContextConfiguration(locations = {"classpath:springConfig_test.xml"})
public class CDPlayerTest2 {
    @Autowired
    private CompactDisc cd;

    @Test
    @DisplayName("cd不为空")
    public void CDShouldNoBeNull(){
        Assertions.assertNotNull(cd);
    }

    @Test
    @DisplayName("测试play方法")
    public void testPlay(){
        cd.play();
        System.out.println(cd.toString());
    }
}
